<template>
  <el-row class="home" :gutter="20">
    <home-left :tableData="tableData"></home-left>
    <home-right :countData="countData"></home-right>
  </el-row>
</template>
<script>
  import HomeLeft from '@/components/home/HomeLeft'
  import HomeRight from '@/components/home/HomeRight'
  export default {
    name: "Home",
    components: {
      HomeLeft,
      HomeRight,
    },
    data() {
      return {
        countData: [],
        tableData: [],
      }
    },
    methods: {
      getData() {
        this.$http.get('/home/getData').then(
          res => {
            this.countData = res.data.data.countData
            this.tableData = res.data.data.tableData
          }
        )
      },
    },
    created() {
      this.$store.dispatch('getHomeData')   //图形数据用的是vuex
      this.getData()
    },
  }
</script>
<style lang="scss" scoped>
</style>